﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Domain.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Admin",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    AdminName = table.Column<string>(maxLength: 255, nullable: true),
                    AdminPass = table.Column<string>(maxLength: 255, nullable: true),
                    Status = table.Column<int>(nullable: false),
                    Roles = table.Column<string>(maxLength: 500, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Admin", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "AdminRoles",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Roles = table.Column<string>(maxLength: 255, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AdminRoles", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Banner",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    Category = table.Column<int>(nullable: false),
                    ImgUrl = table.Column<string>(maxLength: 2000, nullable: true),
                    Data = table.Column<string>(maxLength: 500, nullable: true),
                    Sort = table.Column<int>(nullable: false),
                    Enable = table.Column<bool>(nullable: false),
                    StartTime = table.Column<DateTime>(nullable: false),
                    EndTime = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Banner", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "BlackList",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    Reson = table.Column<string>(nullable: true),
                    AdminID = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BlackList", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "CapitalFlow",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    SerialNO = table.Column<string>(maxLength: 50, nullable: true),
                    UserID = table.Column<int>(nullable: false),
                    PayMoney = table.Column<int>(nullable: false),
                    BizType = table.Column<int>(nullable: false),
                    BizDesc = table.Column<string>(maxLength: 1000, nullable: true),
                    BizParams = table.Column<string>(maxLength: 1000, nullable: true),
                    FlowType = table.Column<int>(nullable: false),
                    Institution = table.Column<string>(maxLength: 20, nullable: true),
                    InstitutionNO = table.Column<string>(maxLength: 50, nullable: true),
                    InstitutionLog = table.Column<string>(maxLength: 2000, nullable: true),
                    InstitutionCT = table.Column<DateTime>(nullable: true),
                    InstitutionTradeSuccess = table.Column<bool>(maxLength: 50, nullable: false),
                    Status = table.Column<int>(nullable: false),
                    StatusName = table.Column<string>(maxLength: 20, nullable: true),
                    IsHandle = table.Column<bool>(nullable: false),
                    HandleInfo = table.Column<string>(maxLength: 2000, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CapitalFlow", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Dic",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    GroupName = table.Column<string>(nullable: true),
                    KeyName = table.Column<string>(nullable: true),
                    KeyValue = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Dic", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "GeTuiRelation",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    GeTuiID = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GeTuiRelation", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "InviteLog",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    Phone = table.Column<string>(maxLength: 20, nullable: true),
                    SuperorCode = table.Column<string>(maxLength: 10, nullable: true),
                    UserID = table.Column<int>(nullable: false),
                    SuperorID = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InviteLog", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "LoginLog",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    IP = table.Column<string>(nullable: true),
                    Platfrom = table.Column<string>(nullable: true),
                    Infomation = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LoginLog", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "PayCallBackLog",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    FlowType = table.Column<int>(nullable: false),
                    SerialNO = table.Column<string>(maxLength: 50, nullable: true),
                    InstitutionNO = table.Column<string>(maxLength: 50, nullable: true),
                    InstitutionLog = table.Column<string>(maxLength: 2000, nullable: true),
                    InstitutionCT = table.Column<DateTime>(nullable: true),
                    InstitutionTradeSuccess = table.Column<bool>(maxLength: 50, nullable: false),
                    IsHandle = table.Column<bool>(nullable: false),
                    IsError = table.Column<bool>(nullable: false),
                    HandleInfo = table.Column<string>(maxLength: 2000, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PayCallBackLog", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "RealNameInfo",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    CardNO = table.Column<string>(maxLength: 20, nullable: true),
                    RealName = table.Column<string>(maxLength: 10, nullable: true),
                    Status = table.Column<int>(nullable: false),
                    VideoUrl = table.Column<string>(maxLength: 2000, nullable: true),
                    LivenessType = table.Column<string>(maxLength: 10, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RealNameInfo", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Role",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    Name = table.Column<string>(maxLength: 255, nullable: true),
                    RolePermissions = table.Column<string>(maxLength: 5000, nullable: true),
                    Status = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Role", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "SmsCode",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    Phone = table.Column<string>(maxLength: 20, nullable: true),
                    SmsCodeType = table.Column<int>(nullable: false),
                    SmsCode = table.Column<string>(maxLength: 10, nullable: true),
                    OutTime = table.Column<DateTime>(nullable: false),
                    IsUse = table.Column<bool>(nullable: false),
                    SendSuccess = table.Column<bool>(nullable: false),
                    SendMsg = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SmsCode", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Task",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    FinishTime = table.Column<DateTime>(nullable: true),
                    IsFinishAll = table.Column<bool>(nullable: false),
                    LimitTime = table.Column<int>(nullable: false),
                    LimitAudit = table.Column<int>(nullable: false),
                    FieldData = table.Column<string>(maxLength: 2000, nullable: true),
                    StepFieldData = table.Column<string>(maxLength: 2000, nullable: true),
                    SubFieldName = table.Column<string>(nullable: true),
                    NeedSubField = table.Column<bool>(nullable: false),
                    FreshTime = table.Column<DateTime>(nullable: false),
                    Status = table.Column<int>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    TotalCount = table.Column<int>(nullable: false),
                    RemainCount = table.Column<int>(nullable: false),
                    BeFinishCount = table.Column<int>(nullable: false),
                    Price = table.Column<int>(nullable: false),
                    Version = table.Column<DateTime>(rowVersion: true, nullable: true)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Task", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "TaskCategory",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    Icon = table.Column<string>(maxLength: 2000, nullable: true),
                    Title = table.Column<string>(maxLength: 200, nullable: true),
                    SubTitle = table.Column<string>(maxLength: 200, nullable: true),
                    FieldData = table.Column<string>(maxLength: 2000, nullable: true),
                    NeedTaskStepData = table.Column<bool>(nullable: false),
                    NeedSubField = table.Column<bool>(nullable: false),
                    IsEnable = table.Column<bool>(nullable: false),
                    Sort = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskCategory", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "TaskLog",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    TaskID = table.Column<int>(nullable: false),
                    TaskType = table.Column<int>(nullable: false),
                    TaskTypeName = table.Column<string>(maxLength: 20, nullable: true),
                    Description = table.Column<string>(maxLength: 1000, nullable: true),
                    OperatorID = table.Column<int>(nullable: true),
                    AdminID = table.Column<int>(nullable: true),
                    TaskAuditID = table.Column<int>(nullable: true),
                    BizID = table.Column<Guid>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskLog", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "TaskTake",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    TaskSrcData_TaskID = table.Column<int>(nullable: true),
                    TaskSrcData_FieldData = table.Column<string>(maxLength: 2000, nullable: true),
                    TaskSrcData_StepFieldData = table.Column<string>(maxLength: 2000, nullable: true),
                    TaskSrcData_SubFieldName = table.Column<string>(maxLength: 50, nullable: true),
                    TaskSrcData_TakeLimitTime = table.Column<int>(nullable: true),
                    TaskSrcData_TakeLimitAudit = table.Column<int>(nullable: true),
                    TaskSrcData_Price = table.Column<int>(nullable: true),
                    FromData = table.Column<string>(maxLength: 2000, nullable: true),
                    UserID = table.Column<int>(nullable: false),
                    Status = table.Column<int>(nullable: false),
                    StatusInfo = table.Column<string>(maxLength: 1000, nullable: true),
                    OutTime = table.Column<DateTime>(nullable: false),
                    AuditOutTime = table.Column<DateTime>(nullable: true),
                    RowVersion = table.Column<DateTime>(rowVersion: true, nullable: true)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    IsHandlePay = table.Column<bool>(nullable: false),
                    HandlePayTime = table.Column<DateTime>(nullable: true),
                    HandleInfo = table.Column<string>(maxLength: 1000, nullable: true),
                    PreFee = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskTake", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Wallet",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    InComeBlance = table.Column<int>(nullable: false),
                    ChargeBlance = table.Column<int>(nullable: false),
                    MarginBlance = table.Column<int>(nullable: false),
                    AliPayAccount = table.Column<string>(maxLength: 50, nullable: true),
                    WxPayAccount = table.Column<string>(maxLength: 50, nullable: true),
                    Version = table.Column<DateTime>(rowVersion: true, nullable: true)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    AliPayAccountName = table.Column<string>(maxLength: 50, nullable: true),
                    WxPayAccountName = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Wallet", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "WalletLog",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    IsDelete = table.Column<bool>(nullable: false),
                    Identity = table.Column<Guid>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    WalletID = table.Column<int>(nullable: false),
                    BizNO = table.Column<string>(maxLength: 50, nullable: true),
                    BizType = table.Column<string>(maxLength: 50, nullable: true),
                    BizDesc = table.Column<string>(maxLength: 100, nullable: true),
                    HistoryBlance = table.Column<int>(nullable: false),
                    ChangeMoney = table.Column<int>(nullable: false),
                    Remark = table.Column<string>(maxLength: 1000, nullable: true),
                    LogType = table.Column<string>(maxLength: 20, nullable: false),
                    Data = table.Column<string>(maxLength: 500, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WalletLog", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "WithDraw",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    Money = table.Column<int>(nullable: false),
                    TaxFee = table.Column<int>(nullable: false),
                    AccountType = table.Column<int>(nullable: false),
                    WalletType = table.Column<int>(nullable: false),
                    Status = table.Column<int>(nullable: false),
                    StatusName = table.Column<string>(maxLength: 20, nullable: true),
                    ReceiveMoney = table.Column<int>(nullable: false),
                    BizNo = table.Column<long>(nullable: false),
                    PayInfo = table.Column<string>(nullable: true),
                    Version = table.Column<DateTime>(rowVersion: true, nullable: true)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    AuditStatus = table.Column<int>(nullable: false),
                    AuditOperator = table.Column<string>(maxLength: 20, nullable: true),
                    ErrorMsg = table.Column<string>(maxLength: 200, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WithDraw", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "Wxmini",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    UserID = table.Column<int>(nullable: false),
                    HeadImg = table.Column<string>(maxLength: 500, nullable: true),
                    WxUnionID = table.Column<string>(maxLength: 255, nullable: true),
                    WxOpenID = table.Column<string>(maxLength: 255, nullable: true),
                    WxData = table.Column<string>(maxLength: 65535, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Wxmini", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "UserInfo",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    Identity = table.Column<Guid>(nullable: false),
                    IsDelete = table.Column<bool>(nullable: false),
                    NickName = table.Column<string>(maxLength: 255, nullable: true),
                    Phone = table.Column<string>(maxLength: 255, nullable: true),
                    Pwd = table.Column<string>(maxLength: 255, nullable: true),
                    UserLevel = table.Column<int>(nullable: false),
                    TraderLevel = table.Column<int>(nullable: false),
                    SuperorID = table.Column<int>(nullable: false),
                    SuperorPath = table.Column<string>(maxLength: 1000, nullable: true),
                    Status = table.Column<int>(nullable: false),
                    TaskCount = table.Column<int>(nullable: false),
                    InviteCode = table.Column<string>(maxLength: 10, nullable: true),
                    HeadImg = table.Column<string>(maxLength: 500, nullable: true),
                    WxUnionID = table.Column<string>(maxLength: 255, nullable: true),
                    LastLoginTime = table.Column<DateTime>(nullable: true),
                    IsValidRealNameInfo = table.Column<bool>(nullable: false),
                    RealNameInfoID = table.Column<int>(nullable: true),
                    WxOpenID = table.Column<string>(maxLength: 255, nullable: true),
                    WxData = table.Column<string>(maxLength: 65535, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfo", x => x.ID);
                    table.ForeignKey(
                        name: "FK_UserInfo_RealNameInfo_RealNameInfoID",
                        column: x => x.RealNameInfoID,
                        principalTable: "RealNameInfo",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateTable(
                name: "TaskAudit",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    PayMoney = table.Column<int>(nullable: false),
                    AuditStatus = table.Column<int>(nullable: false),
                    AuditInfo = table.Column<string>(nullable: true),
                    AdminID = table.Column<int>(nullable: true),
                    IsPay = table.Column<bool>(nullable: false),
                    Order = table.Column<int>(nullable: false),
                    FinishTime = table.Column<DateTime>(nullable: true),
                    IsFinishAll = table.Column<bool>(nullable: false),
                    IsAdd = table.Column<bool>(nullable: false),
                    Price = table.Column<int>(nullable: false),
                    Count = table.Column<int>(nullable: false),
                    TotalMoney = table.Column<int>(nullable: false),
                    PayID = table.Column<int>(nullable: false),
                    LimitTime = table.Column<int>(nullable: false),
                    LimitAudit = table.Column<int>(nullable: false),
                    TaskAggregateID = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TaskAudit", x => x.ID);
                    table.ForeignKey(
                        name: "FK_TaskAudit_Task_TaskAggregateID",
                        column: x => x.TaskAggregateID,
                        principalTable: "Task",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateTable(
                name: "LevelLog",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    PayID = table.Column<int>(nullable: false),
                    Time = table.Column<int>(nullable: false),
                    PayMoney = table.Column<int>(nullable: false),
                    OutTime = table.Column<DateTime>(nullable: false),
                    LogType = table.Column<string>(maxLength: 10, nullable: false),
                    TraderLevel = table.Column<int>(nullable: true),
                    Idx_TraderLevelID = table.Column<int>(nullable: true),
                    UserLevel = table.Column<int>(nullable: true),
                    Idx_UserLevelID = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LevelLog", x => x.ID);
                    table.ForeignKey(
                        name: "FK_LevelLog_UserInfo_Idx_TraderLevelID",
                        column: x => x.Idx_TraderLevelID,
                        principalTable: "UserInfo",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                    table.ForeignKey(
                        name: "FK_LevelLog_UserInfo_Idx_UserLevelID",
                        column: x => x.Idx_UserLevelID,
                        principalTable: "UserInfo",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateTable(
                name: "UserProps",
                columns: table => new
                {
                    ID = table.Column<int>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    CreateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    UpdateTime = table.Column<DateTime>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
                    PropType = table.Column<int>(nullable: false),
                    TotalCount = table.Column<int>(nullable: false),
                    UseCount = table.Column<int>(nullable: false),
                    PayMoney = table.Column<int>(nullable: false),
                    UserInfoAggregateID = table.Column<int>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserProps", x => x.ID);
                    table.ForeignKey(
                        name: "FK_UserProps_UserInfo_UserInfoAggregateID",
                        column: x => x.UserInfoAggregateID,
                        principalTable: "UserInfo",
                        principalColumn: "ID",
                        onDelete: ReferentialAction.Restrict);
                });

            migrationBuilder.CreateIndex(
                name: "IX_BlackList_UserID",
                table: "BlackList",
                column: "UserID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_Dic_GroupName_KeyName",
                table: "Dic",
                columns: new[] { "GroupName", "KeyName" });

            migrationBuilder.CreateIndex(
                name: "IX_GeTuiRelation_UserID",
                table: "GeTuiRelation",
                column: "UserID");

            migrationBuilder.CreateIndex(
                name: "IX_LevelLog_CreateTime",
                table: "LevelLog",
                column: "CreateTime");

            migrationBuilder.CreateIndex(
                name: "IX_LevelLog_Idx_TraderLevelID",
                table: "LevelLog",
                column: "Idx_TraderLevelID");

            migrationBuilder.CreateIndex(
                name: "IX_LevelLog_CreateTime1",
                table: "LevelLog",
                column: "CreateTime");

            migrationBuilder.CreateIndex(
                name: "IX_LevelLog_Idx_UserLevelID",
                table: "LevelLog",
                column: "Idx_UserLevelID");

            migrationBuilder.CreateIndex(
                name: "IX_PayCallBackLog_InstitutionNO",
                table: "PayCallBackLog",
                column: "InstitutionNO",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_PayCallBackLog_SerialNO",
                table: "PayCallBackLog",
                column: "SerialNO",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_SmsCode_Phone",
                table: "SmsCode",
                column: "Phone");

            migrationBuilder.CreateIndex(
                name: "IX_Task_FinishTime",
                table: "Task",
                column: "FinishTime");

            migrationBuilder.CreateIndex(
                name: "IX_Task_UserID",
                table: "Task",
                column: "UserID");

            migrationBuilder.CreateIndex(
                name: "IX_TaskAudit_TaskAggregateID",
                table: "TaskAudit",
                column: "TaskAggregateID");

            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_InviteCode",
                table: "UserInfo",
                column: "InviteCode",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_Phone",
                table: "UserInfo",
                column: "Phone",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_RealNameInfoID",
                table: "UserInfo",
                column: "RealNameInfoID");

            migrationBuilder.CreateIndex(
                name: "IX_UserInfo_WxUnionID",
                table: "UserInfo",
                column: "WxUnionID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_UserProps_UserInfoAggregateID",
                table: "UserProps",
                column: "UserInfoAggregateID");

            migrationBuilder.CreateIndex(
                name: "IX_Wallet_UserID",
                table: "Wallet",
                column: "UserID",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_WalletLog_CreateTime",
                table: "WalletLog",
                column: "CreateTime");

            migrationBuilder.CreateIndex(
                name: "IX_WalletLog_UserID",
                table: "WalletLog",
                column: "UserID");

            migrationBuilder.CreateIndex(
                name: "IX_WithDraw_Identity",
                table: "WithDraw",
                column: "Identity");

            migrationBuilder.CreateIndex(
                name: "IX_WithDraw_UserID",
                table: "WithDraw",
                column: "UserID");

            migrationBuilder.CreateIndex(
                name: "IX_Wxmini_UserID",
                table: "Wxmini",
                column: "UserID");

            migrationBuilder.CreateIndex(
                name: "IX_Wxmini_WxOpenID",
                table: "Wxmini",
                column: "WxOpenID");

            migrationBuilder.CreateIndex(
                name: "IX_Wxmini_WxUnionID",
                table: "Wxmini",
                column: "WxUnionID");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Admin");

            migrationBuilder.DropTable(
                name: "AdminRoles");

            migrationBuilder.DropTable(
                name: "Banner");

            migrationBuilder.DropTable(
                name: "BlackList");

            migrationBuilder.DropTable(
                name: "CapitalFlow");

            migrationBuilder.DropTable(
                name: "Dic");

            migrationBuilder.DropTable(
                name: "GeTuiRelation");

            migrationBuilder.DropTable(
                name: "InviteLog");

            migrationBuilder.DropTable(
                name: "LevelLog");

            migrationBuilder.DropTable(
                name: "LoginLog");

            migrationBuilder.DropTable(
                name: "PayCallBackLog");

            migrationBuilder.DropTable(
                name: "Role");

            migrationBuilder.DropTable(
                name: "SmsCode");

            migrationBuilder.DropTable(
                name: "TaskAudit");

            migrationBuilder.DropTable(
                name: "TaskCategory");

            migrationBuilder.DropTable(
                name: "TaskLog");

            migrationBuilder.DropTable(
                name: "TaskTake");

            migrationBuilder.DropTable(
                name: "UserProps");

            migrationBuilder.DropTable(
                name: "Wallet");

            migrationBuilder.DropTable(
                name: "WalletLog");

            migrationBuilder.DropTable(
                name: "WithDraw");

            migrationBuilder.DropTable(
                name: "Wxmini");

            migrationBuilder.DropTable(
                name: "Task");

            migrationBuilder.DropTable(
                name: "UserInfo");

            migrationBuilder.DropTable(
                name: "RealNameInfo");
        }
    }
}
